import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_spectrum/flutter_spectrum.dart';
import 'package:flutter_spectrum/flutter_spectrum_platform_interface.dart';
import 'package:flutter_spectrum/flutter_spectrum_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterSpectrumPlatform
    with MockPlatformInterfaceMixin
    implements FlutterSpectrumPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  listenPcm(EventHandler onEvent, EventHandler onError) {
    // TODO: implement listenPcm
    throw UnimplementedError();
  }

  @override
  Future<void> startPlay(String filePath) {
    // TODO: implement startPlay
    throw UnimplementedError();
  }

  @override
  Future<void> stopPlay() {
    // TODO: implement stopPlay
    throw UnimplementedError();
  }

  @override
  onPlayCompleted(EventHandler onEvent) {
    // TODO: implement onPlayCompleted
    throw UnimplementedError();
  }
}

void main() {
  final FlutterSpectrumPlatform initialPlatform = FlutterSpectrumPlatform.instance;

  test('$MethodChannelFlutterSpectrum is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterSpectrum>());
  });

  test('getPlatformVersion', () async {
    FlutterSpectrum flutterSpectrumPlugin = FlutterSpectrum();
    MockFlutterSpectrumPlatform fakePlatform = MockFlutterSpectrumPlatform();
    FlutterSpectrumPlatform.instance = fakePlatform;

    // expect(await flutterSpectrumPlugin.getPlatformVersion(), '42');
  });
}
